package com.qf.controller;

import com.github.pagehelper.PageInfo;
import com.qf.entity.AdminUser;
import com.qf.entity.Menu;
import com.qf.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;
import java.util.List;


@Controller
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping("/queryMenus")
    @ResponseBody
    public List<Menu> queryMenu(HttpSession session){
        AdminUser adminUser = (AdminUser) session.getAttribute("adminUser");
        List<Menu> menus = menuService.queryMenu(adminUser.getId());
        return menus;
    }



}
